<%--
    活动申请界面
    Author: scm
    Date: 2023-12-12
    Version: 1.0
--%>
<%--
    返回的数据：新活动的activityName，startTime，endTime，place，description
    根据返回的数据创建activity，注意前端不会返回Activity所有的属性
--%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page session="true" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/bootstrap.css">
  <link rel="stylesheet" href="<c:url value="/resources/css/systemStyle.css"/>">
  <title>校园社团管理系统</title>
</head>
<body>
<!-- 顶部导航栏 -->
<jsp:include page="./header.jsp" />
<div class="content container">
  <div class="fs-4 fw-bolder">活动申请</div>
  <div class="text-center">
    <c:if test="${!empty sessionScope.deleted}">
      <c:choose>
        <c:when test="${sessionScope.deleted}">
          <span class="text-success">发布成功!</span>
          <c:remove var="deleted" scope="session"/>
        </c:when>
        <c:otherwise>
          <span class="text-danger">发布失败</span>
          <c:remove var="deleted" scope="session"/>
        </c:otherwise>
      </c:choose>
    </c:if>
  </div>
  <div class="d-flex justify-content-center mt-4">
    <form action="<c:url value='../clubAdministrator/activityApplication' />" method="post" class="col-9">
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon1">活动标题</span>
        <input type="text" class="form-control" placeholder="" aria-label="title" name="activityName" required>
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="startTime">开始时间：</span>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="yyyy" />" name="startYear" id="startYear" min="1970" max="2100">
          <label for="startYear">年</label>
        </div>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="MM" />" name="startMonth" id="startMonth" min="1" max="12">
          <label for="startMonth">月</label>
        </div>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="dd" />" id="startDay" name="startDay" min="1" max="31">
          <label for="startDay">日</label>
        </div>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="HH" />" id="startHour" name="startHour" min="0" max="24">
          <label for="startHour">时</label>
        </div>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="mm" />" id="startMin" name="startMin" min="0" max="60">
          <label for="startMin">分</label>
        </div>
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="endTime">结束时间：</span>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="yyyy" />" name="endYear" id="endYear" min="1970" max="2100">
          <label for="endYear">年</label>
        </div>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="MM" />" name="endMonth" id="endMonth" min="1" max="12">
          <label for="endMonth">月</label>
        </div>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="dd" />" id="endDay" name="endDay" min="1" max="31">
          <label for="endDay">日</label>
        </div>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="HH" />" id="endHour" name="endHour" min="0" max="24">
          <label for="endHour">时</label>
        </div>
        <div class="col form-floating">
          <input type="number" class="form-control" value="<fmt:formatDate value="${now}" pattern="mm" />" id="endMin" name="endMin" min="0" max="60">
          <label for="endMin">分</label>
        </div>
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="place">地点：</span>
        <input type="text" class="form-control" placeholder="" name="place" aria-label="place" required>
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="description">活动描述：</span>
        <textarea type="text" class="form-control" placeholder="" name="description" aria-label="With textarea" required></textarea>
      </div>
      <button type="submit" class="btn btn-outline-success mx-2">发布</button>
      <button type="reset" class="btn btn-outline-secondary">清空</button>
    </form>
  </div>
</div>
<div style="height: 10rem"></div>
<!-- footer -->
<jsp:include page="./footer.jsp" />
<script src="<c:url value="/resources/js/bootstrap.bundle.js" />"></script>
</body>
</html>